import Vue from 'vue'
import Router from 'vue-router'

/* layout*/
import Layout from '../views/layout/layout';

import Abouts from '../views/comps/abouts';

import Button from '../views/comps/button';
import Badges from '../views/comps/badges';
import Table from '../views/comps/table';
import Card from '../views/comps/card';
import Grid from '../views/comps/grid';
import Input from '../views/comps/input';
import Form from '../views/comps/form';

import Header from '../views/comps/header';
import Popup from '../views/comps/popup';
import Picker from '../views/comps/picker';
import DatetimePicker from '../views/comps/datetime-picker';
import MessageBox from '../views/comps/message-box';
import Toast from '../views/comps/toast';
import ActionSheet from '../views/comps/actionSheet';
import Upload from '../views/comps/upload';
import Keyboard from '../views/comps/keyboard';
import Spinner from '../views/comps/spinner';
import Indicator from '../views/comps/indicator';
import Swiper from '../views/comps/swiper';
import Lazyload from '../views/comps/lazyload';

Vue.use(Router)

export const constantRouterMap = [{
  path: '/',
  name: 'Layout',
  hidden: true,
  component: Layout,
  redirect: '/abouts',
  children: [{
      path: '/abouts',
      name: 'Abouts',
      title: '关于',
      hidden: true,
      component: Abouts
    }, {
      path: '/button',
      name: 'Button',
      title: '按钮',
      hidden: true,
      component: Button
    }, {
      path: '/badges',
      name: 'Badges',
      title: '标签',
      hidden: true,
      component: Badges
    }, {
      path: '/table',
      name: 'Table',
      title: '表格',
      hidden: true,
      component: Table
    }, {
      path: '/card',
      name: 'Card',
      title: '卡片',
      hidden: true,
      component: Card
    }, {
      path: '/grid',
      name: 'Grid',
      title: 'flex布局',
      hidden: true,
      component: Grid
    }, {
      path: '/input',
      name: 'Input',
      title: 'input',
      hidden: true,
      component: Input
    },
    {
      path: '/form',
      name: 'Form',
      title: 'Form',
      hidden: true,
      component: Form
    },
    {
      path: '/header',
      name: 'Header',
      title: '导航',
      hidden: true,
      component: Header
    }, {
      path: '/popup',
      name: 'Popup',
      title: '弹窗',
      hidden: true,
      component: Popup
    }, {
      path: '/picker',
      name: 'Picker',
      title: 'picker',
      hidden: true,
      component: Picker
    },
    {
      path: '/datetimePicker',
      name: 'DatetimePicker',
      title: 'datetimePicker',
      hidden: true,
      component: DatetimePicker
    },
    {
      path: '/messageBox',
      name: 'MessageBox',
      title: 'MessageBox',
      hidden: true,
      component: MessageBox
    },
    {
      path: '/toast',
      name: 'Toast',
      title: 'Toast',
      hidden: true,
      component: Toast
    },
    {
      path: '/actionSheet',
      name: 'ActionSheet',
      title: 'ActionSheet',
      hidden: true,
      component: ActionSheet
    },
    {
      path: '/upload',
      name: 'Upload',
      title: 'Upload',
      hidden: true,
      component: Upload
    },
    {
      path: '/keyboard',
      name: 'Keyboard',
      title: 'Keyboard',
      hidden: true,
      component: Keyboard
    },
    {
      path: '/spinner',
      name: 'Spinner',
      title: 'Spinner',
      hidden: true,
      component: Spinner
    },
    {
      path: '/indicator',
      name: 'Indicator',
      title: 'Indicator',
      hidden: true,
      component: Indicator
    },
    {
      path: '/swiper',
      name: 'Swiper',
      title: 'Swiper',
      hidden: true,
      component: Swiper
    },
    {
      path: '/lazyload',
      name: 'Lazyload',
      title: 'Lazyload',
      hidden: true,
      component: Lazyload
    }
  ],
}, ];

export default new Router({
  scrollBehavior: () => ({
    y: 0
  }),
  routes: constantRouterMap
})
